home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / UNIXTOOL / UNIXLIB37B / !UnixLib37_src_sys_c_errlist < prev    next >
Encoding:
C/C++ Source or Header  |  1996-11-09  |  5.5 KB  |  154 lines

  1. /****************************************************************************
  2.  *
  3.  * $Source: /unixb/home/unixlib/source/unixlib37/src/sys/c/RCS/errlist,v $
  4.  * $Date: 1996/11/09 18:02:54 $
  5.  * $Revision: 1.4 $
  6.  * $State: Rel $
  7.  * $Author: unixlib $
  8.  *
  9.  * $Log: errlist,v $
  10.  * Revision 1.4  1996/11/09 18:02:54  unixlib
  11.  * Remove extraneous error string.
  12.  *
  13.  * Revision 1.3  1996/10/30 21:59:00  unixlib
  14.  * Massive changes made by Nick Burret and Peter Burwood.
  15.  *
  16.  * Revision 1.2  1996/09/16 21:23:52  unixlib
  17.  * CL_0002 Nick Burret
  18.  * Minor changes to file handling
  19.  * Change most error numbers, and use in assembler sources (SJC)
  20.  * Various minor bug fixes and compatability changes.
  21.  *
  22.  * Revision 1.1  1996/04/19 21:34:24  simon
  23.  * Initial revision
  24.  *
  25.  ***************************************************************************/
  26.  
  27. static const char rcs_id[] = "$Id: errlist,v 1.4 1996/11/09 18:02:54 unixlib Rel $";
  28.  
  29. #include <string.h>
  30. #include <errno.h>
  31.  
  32. int sys_nerr = __SYS_NERR + 1;
  33.  
  34. char *sys_errlist[__SYS_NERR + 1] =
  35. {
  36.   "Error 0",
  37.   "Operation not permitted",                     /* EPERM */
  38.   "No such file or directory",             /* ENOENT */
  39.   "No such process",                  /* ESRCH */
  40.   "Interrupted system call",             /* EINTR */
  41.   "Input/output error",                 /* EIO */
  42.   "No such device or address",             /* ENXIO */
  43.   "Argument list too long",             /* E2BIG */
  44.   "Exec format error",                 /* ENOEXEC */
  45.   "Bad file descriptor",             /* EBADF */
  46.   "No child processes",                 /* ECHILD */
  47.   "Resource deadlock avoided",             /* EDEADLK */
  48.   "Cannot allocate memory",             /* ENOMEM */
  49.   "Permission denied",                 /* EACCES */
  50.   "Bad address",                 /* EFAULT */
  51.   "Block device required",             /* ENOTBLK */
  52.   "Device busy",                 /* EBUSY */
  53.   "File exists",                 /* EEXIST */
  54.   "Invalid cross-device link",             /* EXDEX */
  55.   "Operation not supported by device",         /* ENODEV */
  56.   "Not a directory",                       /* ENOTDIR */
  57.   "Is a directory",                 /* EISDIR */
  58.   "Invalid argument",                 /* EINVAL */
  59.   "Too many open files in system",         /* ENFILE */
  60.   "Too many open files",             /* EMFILE */
  61.   "Inappropriate ioctl for device",         /* ENOTTY */
  62.   "Text file busy",                        /* ETXTBSY */
  63.   "File too large",                 /* EFBIG */
  64.   "No space left on device",             /* ENOSPC */
  65.   "Illegal seek",                    /* ESPIPE */
  66.   "Read-only file system",             /* EROFS */
  67.   "Too many links",                 /* EMLINK */
  68.   "Broken pipe",                 /* EPIPE */
  69.   "Argument out of domain",             /* EDOM */
  70.   "Range error",                    /* ERANGE */
  71.   "Operation would block",             /* EWOULDBLOCK */
  72.   "Operation now in progress",             /* EINPROGRESS */
  73.   "Operation already in progress",         /* EALREADY */
  74.   "Socket operation on non-socket",         /* ENOTSOCK */
  75.   "Destination address required",         /* EDESTADDRREQ */
  76.   "Message too long",                   /* EMSGSIZE */
  77.   "Protocol wrong type for socket",         /* EPROTOTYPE */
  78.   "Option not supported by protocol",          /* ENOPROTOOPT */
  79.   "Protocol not supported",             /* EPROTONOSUPPORT */
  80.   "Socket type not supported",             /* ESOCKTNOSUPPORT */
  81.   "Operation not suppoted",             /* EOPNOTSUPP */
  82.   "Protocol family not supported",         /* EPFNOSUPPORT */
  83.   "Address family not supported by protocol family", /* EAFNOSUPPORT */
  84.   "Address already in use",                    /* EADDRINUSE */
  85.   "Can't assign requested address",         /* EADDRNOTAVAIL */
  86.   "Network is down",                   /* ENETDOWN */
  87.   "Network unreachable",             /* ENETUNREACH */
  88.   "Network dropped connection on reset",     /* ENETRESET */
  89.   "Software caused connection abort",         /* ECONNABORTED */
  90.   "Connection reset by peer",              /* ECONNRESET */
  91.   "No buffer space available",             /* ENOBUFS */
  92.   "Socket is already connected",         /* EISCONN */
  93.   "Socket is not connected",             /* ENOTCONN */
  94.   "Can't send after socket shutdown",         /* ESHUTDOWN */
  95.   "Too many references: can't splice",         /* ETOOMANYREFS */
  96.   "Connection timed out",                  /* ETIMEDOUT */
  97.   "Connection refused",                 /* ECONNREFUSED */
  98.   "Too many levels of symbolic links",         /* ELOOP */
  99.   "File name too long",                        /* ENAMETOOLONG */
  100.   "Host is down",                 /* EHOSTDOWN */
  101.   "Host unreachable",                 /* EHOSTUNREACH */
  102.   "Directory not empty",             /* ENOTEMPTY */
  103.   "Too many processes",                 /* EPROCLIM */
  104.   "Too many users",                 /* EUSERS */
  105.   "Disc quota exceeded",             /* EDQUOT */
  106.   "Stale NFS file handle",             /* ESTALE */
  107.   "Too many levels of remote in path",         /* EREMOTE */
  108.   "RPC struct is bad",                      /* EBADRPC */
  109.   "RPC version wrong",                 /* ERPCMISMATCH */
  110.   "RPC program not available",             /* EPROGUNAVAIL */
  111.   "RPC program version wrong",             /* EPROGMISMATCH */
  112.   "RPC bad procedure for program",         /* EPROCUNAVAIL */
  113.   "No locks available",                  /* ENOLCK */
  114.   "Function not implemented",             /* ENOSYS */
  115.   "Inappropriate file type or format",         /* EFTYPE */
  116.   "Authentication error",                  /* EAUTH */
  117.   "Need authenticator",                 /* ENEEDAUTH */
  118.   "Resource temporarily unavailable",         /* EAGAIN */
  119.   "", /* 83 */
  120.   "", /* 84 */
  121.   "", /* 85 */
  122.   "", /* 86 */
  123.   "", /* 87 */
  124.   "", /* 88 */
  125.   "", /* 89 */
  126.   "", /* 90 */
  127.   "", /* 91 */
  128.   "", /* 92 */
  129.   "", /* 93 */
  130.   "", /* 94 */
  131.   "", /* 95 */
  132.   "", /* 96 */
  133.   "", /* 97 */
  134.   "", /* 98 */
  135.   "", /* 99 */
  136.   "Inappropriate operation for background process", /* EBACKGROUND */
  137.   "Translator died",                              /* EDIED */
  138.   "?",                                  /* ED */
  139.   "A pretty bad error",                    /* EGREGIOUS */
  140.   "?",                                /* EIEIO */
  141.   "Gratuitous error",                    /* EGRATUITOUS */
  142.   "RISC OS error",                    /* EOPSYS */
  143.   "Signal Received"        /* as flagged by SIG_ERR */
  144. };
  145.  
  146. char *
  147. strerror (register int e)
  148. {
  149.   if (e < 0 || e >= sys_nerr)
  150.     return (0);
  151.  
  152.   return (sys_errlist[e]);
  153. }
  154.